import axios from "./axios";
import { getLocalStroage } from "@/utils/localStorage";

export function getSongStyle() {
  return axios({
    url: "/playlist/catlist",
  });
}

export function getTopPlaylist(cat, limit, offset, order) {
  return axios({
    url: "/top/playlist",
    params: {
      cat,
      limit,
      offset,
      order,
    },
  });
}

export function getPlaylistDynamic(id) {
  return axios({
    url: "/playlist/detail",
    params: {
      id,
      cookie: getLocalStroage("cookie"),
    },
  });
}
// 歌词
export function getLyric(id) {
  return axios({
    url: "/lyric",
    params: {
      id,
    },
  });
}
// 歌曲详情
export function getSongDetail(ids) {
  return axios({
    url: "/song/detail",
    params: {
      ids,
    },
  });
}
// 歌曲评论
export function getCommentMusic(id, limit, offset, before) {
  return axios({
    url: "/comment/music",
    params: {
      id,
      limit,
      offset,
      before,
    },
  });
}
// 相似歌曲
export function getSimiSong(id) {
  return axios({
    url: "/simi/song",
    params: {
      id,
    },
  });
}
// 包含这个歌曲的歌单
export function getSimiPlaylist(id) {
  return axios({
    url: "/simi/playlist",
    params: {
      id,
    },
  });
}
